Don't make extensions have to play around with NS_MEDIA
authorAaron Schulz <aaron@users.mediawiki.org>
Tue, 22 Apr 2008 01:06:51 +0000 (01:06 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Tue, 22 Apr 2008 01:06:51 +0000 (01:06 +0000)
includes/Wiki.php

index 2269d27..8930902 100644 (file)
@@ -239,17 +239,17 @@ class MediaWiki {
         * @return Article object
         */
        static function articleFromTitle( &$title ) {
-               $article = null;
-               wfRunHooks( 'ArticleFromTitle', array( &$title, &$article ) );
-               if ( $article ) {
-                       return $article;
-               }
-
                if( NS_MEDIA == $title->getNamespace() ) {
                        // FIXME: where should this go?
                        $title = Title::makeTitle( NS_IMAGE, $title->getDBkey() );
                }
 
+               $article = null;
+               wfRunHooks( 'ArticleFromTitle', array( &$title, &$article ) );
+               if( $article ) {
+                       return $article;
+               }
+
                switch( $title->getNamespace() ) {
                case NS_IMAGE:
                        $file = wfFindFile( $title );